import axios from 'axios'


const request = axios.create({
    baseURL: '/api',
    timeout: 5000
})


request.interceptors.response.use((res) => {
    if (res.status === 200) {
        return res.data
    }
})


export function get(url, params) {
    console.log(params, 'params');

    return request.get(url, { params });
}

export function post(url, data) {
    return request.post(url, data);
}

export default request